<div class="content">
	<div class="breadLine">
		<ul class="breadcrumb">
			<li><a href="">Quản trị</a> <span class="divider">&gt;</span></li>
			<li class="active">Menu</li>
		</ul>
	</div>
	<div class="workplace">
		<div class="row-fluid">
			<div class="span12">
				<div class="head">
					<div class="isw-documents"></div>
					<h1>Menu</h1>
					<div class="clear"></div>
				</div>
				<form accept-charset="utf-8" method="post" action="<?php echo base_url()."admin/bai-viet/them.html";?>" id="">
					<div class="block-fluid">
						<div class="row-form">
							<div class="span3">Thêm Menu</div>
							<div class="span9">
								<?php echo form_error('content_name')?>
								<input type="text" placeholder="Tiêu đề bài viết " value=""
									name="content_name" id=content_name />
							</div>
							<div class="clear"></div>
						</div>
					<script type="text/javascript">
						$(document).ready(function (){
							$("#dicvu").hide();
							$("#bt").hide();
							$("#tintuc").hide();
							$("#menu_type").change(function(){
								var menu = $("#menu_type").val();
								
								if(menu ==  0){									
									$("#dicvu").show();
								}else {
									$("#dicvu").hide();
								}

								if(menu ==  1){									
									$("#tintuc").show();
								}else {
									$("#tintuc").hide();
								}
								

							
								if(menu ==  2){
									$("#bt").show();
									
								}else {
									$("#bt").hide();
								}
							});
						});
					</script>
					
					<script type="text/javascript">

function BrowseServer( startupPath, functionData )
{
	// You can use the "CKFinder" class to render CKFinder in a page:
	var finder = new CKFinder();

	// The path for the installation of CKFinder (default = "/ckfinder/").
	finder.basePath = '../';

	//Startup path in a form: "Type:/path/to/directory/"
	finder.startupPath = startupPath;

	// Name of a function which is called when a file is selected in CKFinder.
	finder.selectActionFunction = SetFileField;

	// Additional data to be passed to the selectActionFunction in a second argument.
	// We'll use this feature to pass the Id of a field that will be updated.
	finder.selectActionData = functionData;

	// Name of a function which is called when a thumbnail is selected in CKFinder.
	finder.selectThumbnailActionFunction = ShowThumbnails;

	// Launch CKFinder
	finder.popup();
}

// This is a sample function which is called when a file is selected in CKFinder.
function SetFileField( fileUrl, data )
{
	document.getElementById( data["selectActionData"] ).value = fileUrl;
}

// This is a sample function which is called when a thumbnail is selected in CKFinder.
function ShowThumbnails( fileUrl, data )
{
	// this = CKFinderAPI
	var sFileName = this.getSelectedFile().name;
	document.getElementById( 'thumbnails' ).innerHTML +=
			'<div class="thumb">' +
				'<img src="' + fileUrl + '" />' +
				'<div class="caption">' +
					'<a href="' + data["fileUrl"] + '" target="_blank">' + sFileName + '</a> (' + data["fileSize"] + 'KB)' +
				'</div>' +
			'</div>';

	document.getElementById( 'preview' ).style.display = "";
	// It is not required to return any value.
	// When false is returned, CKFinder will not close automatically.
	return false;
}
	</script>
						<div class="row-form">
                            <div class="span3">Kiểu menu</div>
                            <div class="span9">
                            	
                                <select name="menu_type" id="menu_type">
                                	<option value="">--- Chọn ---</option>
                                	<option value="0" >Kiểu dịch vụ</option>
                                	<option value="1">Kiểu menu tin tức</option>
									<option value="2">Kiểu menu đơn (Bình thường)</option>
                                </select>
                            </div>
                            <div class="clear"></div>
                        </div>
					
					
					<div class="row-form" id="dicvu" >
                            <div class="span3">Chuyên mục dịch vụ</div>
                            <div class="span9">
                                <select name="menu_id" id="menu_id">
                                	<option value="999">--- Dịch vụ ---</option>
                                	<?php foreach ($dichvu as $dichvus) :?>
									<option value="<?php echo $dichvus['menu_id']?>" ><?php echo $dichvus['menu_name']?></option>
									<?php endforeach;?>
                                </select>
                            </div>
                            <div class="clear"></div>
                        </div>
                        
						 <div class="row-form" id="tintuc" >
                            <div class="span3">Chuyên tin tức</div>
                            <div class="span9">
                                <select name="menu_id1" id="menu_id1">
                                	<option value="999">--- Tin tức ---</option>
                                	<?php foreach ($menutintuc as $menutintucs) :?>
									<option value="<?php echo $menutintucs['menu_id']?>" ><?php echo $menutintucs['menu_name']?></option>
									<?php endforeach;?>
                                </select>
                            </div>
                            <div class="clear"></div>
                        </div>
                        <div class="row-form" id="tintuc">
							<div class="span3">Ảnh đại diện: Áp dụng với tin tức</div>
							<div class="span6">
								<input id="img1" name="img1" type="text" size="60" />
									
							</div>
							<div class="span2">
								<input type="button" class="btn btn-info" value="Browse Server" onclick="BrowseServer( 'Images:/', 'img1' );" />
							</div>
							
							<div class="clear"></div>
						</div>
					
                        
                        
                        
                        <div class="row-form" id="bt">
                            <div class="span3">Chuyên mục bình thường</div>
                            <div class="span9">
                                <select name="menu_id2" id="menu_id2">
                                	<option value="999">--- Chuyên mục bình thường ---</option>
									<?php foreach ($menudon as $menudons) :?>
									<option value="<?php echo $menudons['menu_id']?>" ><?php echo $menudons['menu_name']?></option>
									<?php endforeach;?>
                                </select>
                            </div>
                            <div class="clear"></div>
                        </div>
					
						
						
						<div class="row-form">
							<div class="span1">Mô tả:</div>
							<div class="span11">
								<textarea class="ckeditor" name="description"></textarea>
							</div>
							<div class="clear"></div>
						</div>
						<div class="row-form">
							<div class="span1">Meta keyword :</div>
							<div class="span11">
								<textarea class="" name="metakey"
									placeholder="Meta keyword "></textarea>
							</div>
							<div class="clear"></div>
						</div>
						
						<div class="row-form">
							<div class="span1">Meta Description :</div>
							<div class="span11">
								<textarea class="" name="metades"
									placeholder="Meta Description..."></textarea>
							</div>
							<div class="clear"></div>
						</div>
						<div class="row-form">
							<div class="span3">Vị trí</div>
							<div class="span9">
								<input type="text" placeholder="Vị trí" value=""
									name="order" id="order" />
							</div>
							<div class="clear"></div>
						</div>
						<div class="row-form">
							<div class="span3">Trạng thái:</div>
							<div class="span9">
								<label><input type="radio" name="status" value="0" checked></input>Hiện</label>
								<label><input type="radio" name="status" value="1"></input>Ẩn</label>
							</div>
							<div class="clear"></div>
						</div>

						<div class="row-form">
							<div class="span9">
								<p>
									<button class="btn btn-success" type="submit" id="add">Thêm mới</button>
								</p>
							</div>
							<div class="clear"></div>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
